/**
 * 
 */
package com.dream.house.dao.impl;

import java.util.List;

import cn.com.servyou.base.exception.DAOException;

import com.dream.house.dao.AllowanceDAO;
import com.dream.house.dao.base.HouseBaseDAO;
import com.dream.house.entity.AllowanceDTO;

/**
 * 住房补贴管理DAO实现
 * @author ahk
 * @since 1.0
 */
public class AllowanceDAOImpl extends HouseBaseDAO implements AllowanceDAO {

	/* (non-Javadoc)
	 * @see com.dream.house.dao.AllowanceDAO#saveAllowance(com.dream.house.entity.AllowanceDTO)
	 */
	@Override
	public boolean saveAllowance(AllowanceDTO app) throws DAOException {
		
		return createEntity("saveAllowance", app);
	}

	/* (non-Javadoc)
	 * @see com.dream.house.dao.AllowanceDAO#updateAllowance(com.dream.house.entity.AllowanceDTO)
	 */
	@Override
	public boolean updateAllowance(AllowanceDTO app) throws DAOException {
		
		return updateEntity("updateAllowance", app);
	}

	/* (non-Javadoc)
	 * @see com.dream.house.dao.AllowanceDAO#removeAllowance(java.lang.String)
	 */
	@Override
	public boolean removeAllowance(String djId) throws DAOException {
		return removeEntity("removeAllowance", djId);
	}

	/* (non-Javadoc)
	 * @see com.dream.house.dao.AllowanceDAO#findAllowances(java.util.Map)
	 */
	@SuppressWarnings("unchecked")
	@Override
	public List<AllowanceDTO> findAllowances(AllowanceDTO app)
			throws DAOException {
		
		return getEntitys("findAllowances", app);
	}

	@Override
	public AllowanceDTO getAllowance(String id) throws DAOException {
		return (AllowanceDTO)getEntity("getAllowance",id);
	}
	
	/* (non-Javadoc)
	 * @see cn.com.servyou.base.dao.BaseDAO#getEntityName()
	 */
	@Override
	public String getEntityName() {
		return AllowanceDTO.class.getCanonicalName();
	}

}
